<ion-view view-title="优惠券" class="couponlist">
	<ion-nav-bar ng-class="baseclass">
		<ion-nav-back-button></ion-nav-back-button>
	</ion-nav-bar>
	
	<!--通过副标题来定位-->
	<div class="bar bar-subheader line-bottom padding-0">
		<!--描述：顶部模块-->
		<div class="row top f-color-666">
			<div class="col" on-tap="activeSlide(0)">
				<div ng-class="selectIndex==0?'top-activated':''">未使用({{datanoused}})</div>
			</div>
			<div class="col" on-tap="activeSlide(1)">
				<div ng-class="selectIndex==1?'top-activated':''">已使用({{dataused}})</div>
			</div>
			<div class="col" on-tap="activeSlide(2)">
				<div ng-class="selectIndex==2?'top-activated':''">已过期({{datainvalid}})</div>
			</div>
		</div>
	</div>

	<ion-content class="has-header has-subheader">
		<ion-slide-box delegate-handle="tab-handle" on-touch="onTouch()" on-release="onRelease()" draw-slide="false" on-slide-changed="slideChanged(index)" active-slide="slideIndex" show-pager="false">
			<ion-slide>
				<ion-scroll direction="y" ng-style="myObj" lazy-scroll>
					<ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
					<div class="font-large-my font-gray-my text-center padding" ng-if="data.length==0||data==null">
						<i class="icon ion-sad-outline font-1rem-my"></i> 没有未使用的优惠券.....
					</div>
					<!--描述：列表store_id-->
					<ul class='c-list'>
						<li ng-repeat="c in data" style='padding-left: 10px;'>
							<div class='cover'>
								<span><s>￥</s><b>{{c.amount}}</b><span>
								<p class="margin-top-10-my">使用条件：满{{c.condition}}元</p>
							</div>
							<div style='margin-left: 150px; min-height: 58px;margin-top: -5px;'>
							<p class="ellipsis">
								<span ng-if="c.issue_type==0">发行方：平台</span>
								<!--当发行方是店铺时，店铺只有一个-->
								<span ng-if="c.issue_type==1">
									发行方：<span class="positive" on-tap="onshow_first(c.store_name[0].store_id)">{{c.store_name[0].store_name}}</span>
									<!--<span ng-repeat="store in c.store_name" class="positive">{{store.store_name}}<span ng-if="c.store_name.length>1">、</span>-->
								</span>
							</p>
								<p>{{c.cpns_name}}</p>
								<p>{{c.from_date}}~{{c.to_date}}</p>
								<p class="positive" ng-if="(c.issue_type==0&&c.store_name.length>0)||c.store_goods.length>0||c.store_brand.length>0||c.store_cat.length>0" on-tap="showPopup($index)">查看规则</p>
							</div>
						</li>
					</ul>
					<!--描述：当用户到达页脚或页脚附近时-->
					<ion-infinite-scroll ng-if="!isLoad" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
				</ion-scroll>
			</ion-slide>

			<ion-slide>
				<ion-scroll direction="y" ng-style="myObj" lazy-scroll>
					<ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
					<div class="font-large-my font-gray-my text-center padding" ng-if="data.length==0||data==null">
						<i class="icon ion-sad-outline font-1rem-my"></i> 没有已使用的优惠券.....
					</div>
					<!--描述：列表-->
					<ul class='c-list'>
						<li ng-repeat="c in data" style='padding-left: 10px;'>
							<div class='cover'>
								<span><s>￥</s><b>{{c.amount}}</b><span>
								<p class="margin-top-10-my">使用条件：满{{c.condition}}元</p>
							</div>
							<div style='margin-left: 150px; min-height: 58px;margin-top: -5px;'>
							<p class="ellipsis">
								<span ng-if="c.issue_type==0">发行方：平台</span>
									<span ng-if="c.issue_type==1">发行方：
										<span ng-repeat="store in c.store_name" class="positive">{{store.store_name}}<span ng-if="c.store_name.length>1">、</span>
									</span>
								</span>
							</p>
								<p>{{c.cpns_name}}</p>
								<p>{{c.from_date}}~{{c.to_date}}</p>
								<p class="positive" ng-if="(c.issue_type==0&&c.store_name.length>0)||c.store_goods.length>0||c.store_brand.length>0||c.store_cat.length>0" on-tap="showPopup($index)">查看规则</p>
							</div>
						</li>
					</ul>
					<!--描述：当用户到达页脚或页脚附近时-->
					<ion-infinite-scroll ng-if="!isLoad" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
				</ion-scroll>
			</ion-slide>

			<ion-slide>
				<ion-scroll direction="y" ng-style="myObj" lazy-scroll>
					<ion-refresher pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
					<div class="font-large-my font-gray-my text-center padding" ng-if="data.length==0||data==null">
						<i class="icon ion-sad-outline font-1rem-my"></i> 没有已过期的优惠券.....
					</div>
					<!--描述：列表-->
					<ul class='c-list'>
						<li ng-repeat="c in data" style='padding-left: 10px;'>
							<div class='cover'>
								<span><s>￥</s><b>{{c.amount}}</b><span>
								<p class="margin-top-10-my">使用条件：满{{c.condition}}元</p>
							</div>
							<div style='margin-left: 150px; min-height: 58px;margin-top: -5px;'>
							<p class="ellipsis">
								<span ng-if="c.issue_type==0">发行方：平台</span>
									<span ng-if="c.issue_type==1">发行方：
										<span ng-repeat="store in c.store_name" class="positive">{{store.store_name}}<span ng-if="c.store_name.length>1">、</span>
									</span>
								</span>
							</p>
								<p>{{c.cpns_name}}</p>
								<p>{{c.from_date}}~{{c.to_date}}</p>
								<p class="positive" ng-if="(c.issue_type==0&&c.store_name.length>0)||c.store_goods.length>0||c.store_brand.length>0||c.store_cat.length>0" on-tap="showPopup($index)">查看规则</p>
							</div>
						</li>
					</ul>
					<!--描述：当用户到达页脚或页脚附近时-->
					<ion-infinite-scroll ng-if="!isLoad" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
				</ion-scroll>
			</ion-slide>

		</ion-slide-box>
	</ion-content>
</ion-view>